//
//  ZZBaseNavigationController.m
//  ZZLC
//
//  Created by 杨春至 on 2017/12/13.
//  Copyright © 2017年 ZhongZeng. All rights reserved.
//

#import "ZZBaseNavigationController.h"


@interface ZZBaseNavigationController ()<UINavigationControllerDelegate>

@end

@implementation ZZBaseNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
//    self.delegate = self;
    [self setNavigationBarItem];
}
- (void)setNavigationBarItem{
    UIColor *defaultColor = RGBCOLOR(255, 207, 87);
    self.navigationBar.tintColor = defaultColor;
    NSMutableDictionary * textAttributes =[NSMutableDictionary dictionaryWithObject:defaultColor forKey:NSForegroundColorAttributeName];
    NSShadow *shadow = [[NSShadow alloc] init];
    shadow.shadowOffset = CGSizeZero;
    textAttributes[NSShadowAttributeName] = shadow;
    [self.navigationBar setTitleTextAttributes:textAttributes];
    //    self.navigationBar.barTintColor = RGBCOLOR(63, 66, 71);
    UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KWidth, 64)];
    view.backgroundColor = RGBCOLOR(63, 66, 71);
    [self.navigationBar setBackgroundImage:[view Getimage] forBarMetrics:UIBarMetricsDefault];
    self.navigationController.automaticallyAdjustsScrollViewInsets = NO;

}
- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if (self.viewControllers.count > 0) {
        viewController.hidesBottomBarWhenPushed = YES;
//      self.navigationItem.leftBarButtonItem =  [QMUINavigationButton barButtonItemWithType:QMUINavigationButtonTypeImage title:@"返回" position:QMUINavigationButtonPositionLeft target:nil action:NULL];
//        UIBarButtonItem *backItem = [[UIBarButtonItem alloc]initWithImage:UIImageMake(@"logo") style:UIBarButtonItemStyleDone target:self action:@selector(popSelfSubviewController)];
//        self.navigationBar.rightBarButtonItem = backItem;
    }
    [super pushViewController:viewController animated:animated];
}
- (void)popSelfSubviewController{
    [self popViewControllerAnimated:YES];
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
